<%@ page language="java"
	import="java.util.*"
	pageEncoding="UTF-8"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomMain"%>
<%@page import="com.tjsinfo.tjsoa.common.PaginationSupport"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	PaginationSupport paginationSupport = (PaginationSupport) request
			.getAttribute("meetingRoomList");
	List<MeetingRoomMain> infos = paginationSupport.getItems();
	//页面的翻页用变量
	String pageNoStr = request.getParameter("pageNo");
	if (pageNoStr == null)
		pageNoStr = "0";
	Integer pageNo = Integer.valueOf(pageNoStr);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<html:base />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>天津市粮油集团有限公司</title>
		
		<link rel="stylesheet" type="text/css" href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	  	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
		<style>
#container {
	width: 600px;
	height: 300px;
	border: 3px solid #c3daf9;
}

.calendar {
	background-image: url(<%=basePath%>images/icon_64.gif) !important;
}

.blist {
	background-image: url(<%=basePath%>images/icon_64.gif) !important;
}

.bmenu {
	background-image: url(<%=basePath%>images/ju.gif) !important;
}

.menu-title {
	background: #ebeadb url(<%=basePath%>images/icon_64.gif) repeat-x;
	border-bottom: 1px solid #99bbe8;
	color: #15428b;
	font: bold 10px tahoma, arial, verdana, sans-serif;
	display: block;
	padding: 3px;
}

.lan01 {
	background: url(<%=basePath%>images/lanbg01.gif) no-repeat 0 0;
	width: 6px;
	height: 24px;
}

.lan02 {
	background: url(<%=basePath%>images/lanbg02.gif) repeat-x;
	width: 99%;
	height: 24px;
}

.lan03 {
	background: url(<%=basePath%>images/lanbg03.gif) no-repeat;
	width: 8px;
	height: 24px;
}

.cha {
	padding-top: 3px
}
</style>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
 		function submitpages(value){
			if(value==-1){
				Ext.MessageBox.alert('提示框','<nobr>请重新选择页码</nobr>');
				return ;
			}
			window.location.href='<%=basePath%>tjsinfo/tjsoa/meetingroom/applicationMeetingRoom.do?pageNo='+value+'';
		}
		window.onload = function(){
			var tb = new Ext.Toolbar(
				{
					height:25
				}
			);
		
		    tb.render('menu');
			tb.addFill();
		    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">会议室申请</a>&nbsp;&nbsp;&nbsp;');
		}
	    </script>
	</head>
	<body>
			<div id="right">
		<div style="height: 91%;">
			<div id="menu" style="padding-top:4px;"></div>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
					<tr>
						<td width="100%" valign="top" height="100%">
								<div class="contabwd" id="MeetingRoomList">
									<table class="p_06" width="100%" border="0" cellspacing="0">
										<tr>
											<th width="11%" style="text-align: center">
												会议室名称
											</th>
											<th width="13%" style="text-align: center">
												地点
											</th>
											<th width="11%" style="text-align: center">
												容纳人数
											</th>
											<th width="50%" style="text-align: center">
												备注
											</th>
											<th width="15%" style="text-align: center">
												操作
											</th>
										</tr>
										<%
											int a = 1;
											for (Iterator iterator = infos.iterator(); iterator.hasNext();) {
												MeetingRoomMain mrm = (MeetingRoomMain) iterator.next();
												String name = mrm.getMeetingroomName();
												if(mrm.getMeetingroomName().length()>6)mrm.setMeetingroomName(name.substring(0,6));
												String place = mrm.getPlace();
												if(mrm.getPlace().length()>9)mrm.setPlace(place.substring(0,9));
												String remark = mrm.getRemarks();
												if(mrm.getRemarks().length()>34)mrm.setRemarks(remark.substring(0,34));
												if (a % 2 == 0) {
										%>
										<tr bgcolor="#F4F4F4">
											<td><a title="<%=name %>"><%=mrm.getMeetingroomName()%></a></td>
											<td><a title="<%=place %>"><%=mrm.getPlace()%></a></td>
											<td><%=mrm.getPeopleNumbert()%></td>
											<td><a title="<%=remark %>"><%=mrm.getRemarks()%></a></td>
											<td>

												<a
													href="<%=basePath%>tjsinfo/tjsoa/meetingroom/returnCalendar.do?id=<%=mrm.getId()%>">申请</a>
											</td>
										</tr>
										<%
											} else {
										%>
										<tr>
											<td><a title="<%=name %>"><%=mrm.getMeetingroomName()%></a></td>
											<td><a title="<%=place %>"><%=mrm.getPlace()%></a></td>
											<td><%=mrm.getPeopleNumbert()%></td>
											<td><a title="<%=remark %>"><%=mrm.getRemarks()%></a></td>
											<td>
												<a
													href="<%=basePath%>tjsinfo/tjsoa/meetingroom/returnCalendar.do?id=<%=mrm.getId()%>">申请</a>											
											</td>
										</tr>
										<%
											}
												a++;
											}
										%>
										<tr align="center">
											<td colspan="5">
												<div class="page01">
												共<%=paginationSupport.getTotalCount()%>条,共<%=paginationSupport.getPageCount()%>页&nbsp;&nbsp;
												当前为第<%=pageNo + 1%>页&nbsp;&nbsp;

												<%
													if (paginationSupport.getStartIndex() > 1) {
												%>
												<a
													href="<%=basePath%>tjsinfo/tjsoa/meetingroom/applicationMeetingRoom.do?pageNo=<%=pageNo - 1%>">上一页</a>
												<%
													}
												%>

												<%
													if (paginationSupport.getStartIndex()
															+ paginationSupport.getPageSize() < paginationSupport
															.getTotalCount()) {
												%>
												<a
													href="<%=basePath%>tjsinfo/tjsoa/meetingroom/applicationMeetingRoom.do?pageNo=<%=pageNo + 1%>">下一页</a>
												<%
													}
												%>

												&nbsp;&nbsp; 跳转到
												<select name="selectPage" id="selectPage"
													onchange="submitpages(this.value)">
													<option value="0">
														--跳转--
													</option>
													<%
														for (int pi = 0; pi < paginationSupport.getPageCount(); pi++) {
													%>
													<option value="<%=pi%>"><%=pi + 1%></option>
													<%
														}
													%>
												</select>
												页
											</div>
											</td>
										</tr>
									</table>
								</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<form name="form1" method="post" id="form1">
			<input type="hidden" name="id" value="" />
		</form>
	</body>
</html>
